package self.hoy.demo.grainmall.auth.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import self.hoy.demo.common.ServiceProviderName;
import self.hoy.demo.common.to.MemberTo;
import self.hoy.demo.common.to.auth.WeiboUser;
import self.hoy.demo.common.utils.R;
import self.hoy.demo.grainmall.auth.vo.UserLoginVo;
import self.hoy.demo.grainmall.auth.vo.UserRegisterVo;

@FeignClient(ServiceProviderName.MEMBER)
public interface MemberFeignService {

    @GetMapping("/member/member/information")
    MemberTo getMemberByMobile(@RequestParam("mobile") String mobile);

    @PostMapping("/member/member/checkUnique")
    R checkUnique(@RequestParam("field") String field, @RequestParam("text") String text);

    @PostMapping("/member/member/register")
    R register(@RequestBody UserRegisterVo vo);

    @PostMapping("/member/member/login")
    R login(@RequestBody UserLoginVo vo);


    @PostMapping("/member/member/oauth/login")
    R oauthLogin(@RequestBody WeiboUser vo);
}
